package com.rs.game.player.dialogues;

import com.rs.cache.loaders.NPCDefinitions;

import com.rs.game.ForceTalk;
import com.rs.game.player.Skills;

public class Larry extends Dialogue {
	
	private int npcId;
	
	@Override
	public void start() {
		npcId = (Integer) parameters[0];
		sendOptionsDialogue("Choose an option?",
				"Who are you?",
				"I want to claim my reward.");
		stage = 1;
	}

	@Override
	public void run(int interfaceId, int componentId) {
		if (stage == 1) {
			if (componentId == OPTION_1) {
				sendEntityDialogue(SEND_1_TEXT_CHAT,
						new String[] { NPCDefinitions.getNPCDefinitions(npcId).name,
								"I am Larry and my penguins are located all over Geryon.", "Find them and I will reward you." +
						" Hints or locations can be found on the offcial Geryon forum!" + 
						" Good luck, adventurer. You can check the amount of penguins you've caught so far by doing ::penguins!"
						}, IS_NPC, npcId, 9827);
				stage = 3;
			}
			else if (player.penguin1 == 1 && player.penguin2 == 1 && player.penguin3 == 1 && player.penguin4 == 1 && player.penguin5 == 1 && player.penguin6 == 1 && player.penguin7 == 1 
						&& player.ClaimedReward == false) {
				sendEntityDialogue(SEND_1_TEXT_CHAT,
						new String[] { NPCDefinitions.getNPCDefinitions(npcId).name,
						player.getDisplayName(), ",you did some amazing work! " + "Thank you for finding all my penguins. Please accept the following rewards."
						}, IS_NPC, npcId, 9827);
				stage = 2;
				} else {
					sendEntityDialogue(SEND_1_TEXT_CHAT,
							new String[] { NPCDefinitions.getNPCDefinitions(npcId).name, "You have found a total of " +player.gettotalpeng()+"/7 penguins." +
				" Come back when you have found them all. Or come back again next week if you claimed your reward already." }, IS_NPC, npcId, 9828);
				player.setNextForceTalk(new ForceTalk("I need to find those penguins...."));
				stage = 3;
				}
			}
	
		else if (stage == 2) {
			player.getSkills().addXp(Skills.HUNTER, 667);
			player.getInventory().addItem(995, 7000000);
			player.getInventory().addItem(24155, 1);
			player.setNextForceTalk(new ForceTalk("Penguins... Penguins.... I found them all!"));
			player.ClaimedReward = true;
			player.getPackets().sendGameMessage("You claim your reward for this week, come back again next week.");
			end();
		}
		else if (stage == 3) {
			end();
		}
	} 


	@Override
	public void finish() {
		// TODO Auto-generated method stub
		
	}

}

